package com.xy.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/*
 * @库存表
 */
@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class StockSelect extends Identified implements Serializable {

	@Column(nullable = false)
	private int amount;// 数量

	@ManyToOne(targetEntity = TextBook.class) // 教材
	@JoinColumn(name = "TextBook_Id", referencedColumnName = "id")
	private TextBook textBook;

	// @OneToMany(targetEntity = Cell.class, mappedBy = "stockSelect") // 货架
	@ManyToOne(targetEntity = Cell.class)
	@JoinColumn(name = "Cell_Id", referencedColumnName = "id")
	private Cell cell;

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public TextBook getTextBook() {
		return textBook;
	}

	public void setTextBook(TextBook textBook) {
		this.textBook = textBook;
	}

	public Cell getCell() {
		return cell;
	}

	public void setCell(Cell cell) {
		this.cell = cell;
	}

	public StockSelect() {
		super();
		// TODO Auto-generated constructor stub
	}

}
